counting the number of non negative integer solutions for equation